gtk-demo: Update aspect-ratio when selecting new puzzle
authorBenjamin Otte <otte@redhat.com>
Tue, 10 Jul 2018 11:28:37 +0000 (13:28 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 13 Jul 2018 12:56:04 +0000 (14:56 +0200)
demos/gtk-demo/sliding_puzzle.c

index 5ce5316159d81764d45674c82af4b9cb816cfd30..60762342c96678b7f199805a2d290737206b355b 100644 (file)
@@ -295,6 +295,7 @@ start_puzzle (GdkPaintable *puzzle)
   grid = gtk_grid_new ();
   gtk_widget_set_can_focus (grid, TRUE);
   gtk_container_add (GTK_CONTAINER (frame), grid);
+  gtk_aspect_frame_set (GTK_ASPECT_FRAME (frame), 0.5, 0.5, (float) gdk_paintable_get_intrinsic_aspect_ratio (puzzle), FALSE);
 
   /* Add a key event controller so people can use the arrow
    * keys to move the puzzle */